addpath('Mex');
SAMPLE_XML_PATH='Config/SamplesConfig.xml';
images = {};
for i = [1:360/15]

    % To use the Kinect hardware use :
    KinectHandles=mxNiCreateContext(SAMPLE_XML_PATH);

    % rgb_image = mxNiPhoto(KinectHandles); %This takes an rgb photo
    % rgb_image = permute(rgb_image, [3 2 1]); % This is equivalent to a transposition

    depth_image = mxNiDepth(KinectHandles); % This returns the distance map.
    depth_image = permute(depth_image, [2 1]);
    imshow(depth_image, [0,3000]); colormap('jet');
    images{i} = depth_image;
    mxNiDeleteContext(KinectHandles);
    i
    input('press enter')
end